<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue.js"></script>
</head>
<body>
<div id="demo"  :class="classA ? 'class-a' : 'class-b' ">
    {{message}}

</div>
<style>
    .class-a{
        background: red;
    }
    .class-b{
        background: red;
    }
</style>
<script >

    //创建一个vue的实例
    new Vue({
        el:"#demo",
        data: {
            classA:true,
            list:[1,2,3,4,5,6,7,8],
            message: 'Hello Vue!'
        },
        beforeCreate(){

        },
        created(){

        },
        beforeMount(){

        },
        mounted: ()=> { //挂载元素，获取到DOM节点

        },
        beforeUpdate(){

        },
        updated(){ //挂载元素，获取到DOM节点
        },
        beforeDestroy(){

        },
        destroyed(){

        },
    })
</script>

</body>
</html>